<%@page import="cn.com.entity.Notice"%>
<%@page import="cn.com.entity.News"%>
<%@page import="java.util.List"%>
<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>主页</title>
 <style type="text/css">
#top{width:100%;
	height:550px;
	background-color:#F00}
#middle{height:360px;
	width:100%;
	margin-top:10px;
	}
#zuo{
	width:35%;
	height:360px;
	float:left;}
#zhong{
	width:35%;height:360px;
	float:left;
	margin:10px 0px 10px 5%;
	}
#you{width:20%;
	height:360px;
	float:right;
	margin:10px 0px 10px 5%;
	
	}
#keshi{width:100%;
	height:125px;
	float:none;
	background-color:#69C;
	margin:10px 0px 10px 0px;
clear:both;}
#bottom{width:100%;
	height:200px;
	float:none;
clear:both;
	background-color:#0FF;}
	
#main{height:100%;
	margin:2% 7% 4% 9.8%;
	position:relative;}
	
.adver{
	width:400px;
	border:solid 1px #666;
	margin-left:auto;
	margin-right:auto;
	margin-top:10px;
	}
.Rotator_bg{
		background-color:#E0E0E0;
		height:40px;
		border-top:solid 1px #B4B4B4;
		}
.number{
	    font-size: 14px;
	    font-weight: bold;
	    color: #FFF;
	    background-color: #9E2E07;
	    display: block;
	    border: 1px solid #FFF;
	    width:18px;
	    height:18px;
	    text-align: center;
		margin-left:10px;
		cursor:pointer;
		float:left;
		}	
.numberOver{
		color:#8C2806;
		font-size:14px;
		width:280px;
		background-color:#FFF;
		text-align:center;
		float:left;
		display: block;
		margin-left:10px;
		}	
.ks{
	margin:0.5% 0px 0px 1.5%;}
	
.tubiao{width:80px;
height:90px;
margin:1px 10px 0px 10px;}	

#zhinan{
	
	margin:0px 10px 0px 25px;
	}
	
 a:link {
	color: #FFF;
	text-decoration: none;
}
a:visited {
	text-decoration: none;
	color: #03C;
}
a:hover {
	text-decoration: none;
	color: #69C;
}
a:active {
	text-decoration: none;
}

#newstiao{background-image:url(images/tiao.jpg);
width:100%;
height:50px;
margin:0px 0px 0px 0px;}
#news{
	margin:6px 0px 0px 13%;
	}
#notice{
	margin:6px 0px 0px 13%;
	}

#apDiv1 {
	position:absolute;
	width:35%;
	height:291px;
	z-index:1;
	left: 416px;
	top: 627px;
}
 #apDiv2 {
	position:absolute;
	width:35%;
	height:296px;
	z-index:1;
	left: 417px;
	top: 626px;
}
 </style>
 <script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript">
	//医院实况图片功能
	var title=new Array();
title[0]="1.我院与新疆人民医院签订研究生联合培养协议！";
title[1]="2.我院爱心献血屋正式投入使用，副市长无明明出席启动仪式！";
title[2]="3.我院医生爱心下乡为村名免费做检查！";
title[3]="4.关注军人健康，我院积极开展公益活动！";
var NowFrame = 1;   //最先显示第一张图片
var MaxFrame = 4;   //一共五张图片
function show(d1) {
	if(Number(d1)){
		clearTimeout(theTimer);  //当触动按扭时，清除计时器
		NowFrame=d1;                //设当前显示图片
		}
	for(var i=1;i<(MaxFrame+1);i++){
		if(i==NowFrame){
			
			document.getElementById("Rotator").src ="images/adRotator_"+i+".jpg";   //显示当前图片
			document.getElementById("fig_"+i).innerHTML=title[i-1];       //显示当前图片对应的标题
			document.getElementById("fig_"+i).className="numberOver";    //设置当前标题的CSS样式
         }
		 else{
		 document.getElementById("fig_"+i).innerHTML=i;
		 document.getElementById("fig_"+i).className="number";
		 }
	}
	if(NowFrame == MaxFrame){   //设置下一个显示的图片
		NowFrame = 1;
		}
	else{
		NowFrame++;
		}
}
var theTimer=setInterval('show()', 3000);   //设置定时器，显示下一张图片
window.onload=show;    //页面加载时运行函数show()

$(document).ready(function(){
  		//显示隐藏医院新闻
		$("#news").mouseover(function(){
    	$("#apDiv1").show();
		$("#apDiv2").hide();
  		});
		
		
		//显示隐藏医院公告
		$("#notice").mouseover(function(){
    	$("#apDiv2").show();
		$("#apDiv1").hide();
  		});

});



</script> 

</head>

<body>
<div id="main">
	

		<div id="top"><iframe src="title.html" width="100%" height="550px" scrolling="no" MARGINHEIGHT="0" MARGINWIDTH="0" align="middle"	frameborder="0"></iframe></div>
		
		<div id="middle">
      		<div id="zuo">
            	<div class="adver">
					<img src="images/adRotator_1.jpg" alt="图片" id="Rotator"/>
					<div class="Rotator_bg">
					<div class="number" id="fig_1" onclick="show(1);">1</div>
					<div class="number" id="fig_2" onclick="show(2);">2</div>
                    <div class="number" id="fig_3" onclick="show(3);">3</div>
                    <div class="number" id="fig_4" onclick="show(4);">4</div>
					</div>	
            	</div>
            
            </div>
        	<div id="zhong">
       	  <div id="newstiao" > 
                	<img src="images/news.jpg" id="news"/>
                   <img src="images/notice.jpg" id="notice"/>
           <div id="apDiv1" >
            	<table width="80%"  align="center">
   <%
   	List<News> newslist=(List<News>)session.getAttribute("newslist");
   	for(int i=0;i<newslist.size();i++){
	   News news=newslist.get(i);
   %>         	
                	<tr >
                		
                    	<td align="left"><%=news.getNewstitle() %></td>
                        <td align="right"><%=news.getNewspublishedtime() %></td>
                    </tr>
                    
                    <tr align="center">
                    	
                    	<td colspan="2" >
                        	<hr width="100%" />
                        </td>
                    </tr>
    <%} %>                
                </table>
            
            </div>
           		<div id="apDiv2" style="display:none;">
                <table width="80%" align="center">
    <%
   	List<Notice> noticelist=(List<Notice>)session.getAttribute("noticelist");
   	for(int i=0;i<noticelist.size();i++){
	   Notice notice=noticelist.get(i);
   %>               
                
                	<tr>
                    	<td align="left"><%=notice.getNoticetitle() %></td>
                        <td align="right"><%=notice.getNoticepublishedtime() %></td>
                    </tr>
                    <tr>
                    	<td colspan="2">
                        	<hr width="100%"/>
                        </td>
                    </tr>
   <%} %>                 
                </table> 
                </div>
       	 
          </div>
          </div>
        	<div id="you">
            	<img src="images/zhinan.jpg"  id="zhinan" /><br/>
                <a href=""><img src="images/jiaotongweizhi.jpg" width="150" height="150" border="3" class="tubiao"  id="jiaotong"/></a>
                <a href=""><img src="images/menzhen.jpg" border="3" class="tubiao"  id="menzhen"/></a><br/>
               <a href=""> <img src="images/yibao.jpg" name="yiyao" border="3" class="tubiao"  id="yiyao"/></a>
                <a href=""><img src="images/guahao.jpg" border="3" class="tubiao"  id="guahao"/></a><br/>
               <a href=""> <img src="images/tijian.jpg" border="3" class="tubiao"  id="tijian"/></a>
               <a href=""> <img src="images/zhuyuan.jpg" border="3" class="tubiao"  id="zhuyuan"/></a>
            
            </div>
    	</div>
	
		<div id="keshi" >
        			<img src="images/keshi.jpg"  id="zhongdiankeshi" class="ks"/>
                    <a href=""><img src="images/ks-1.gif" border="2"  class="ks"  id="ks1"/></a>
                    <a href=""><img src="images/ks-2.gif" border="2"  class="ks"  id="ks2"/></a>
                    <a href=""><img src="images/ks-3.gif" border="2"  class="ks"  id="ks3"/></a>
                 <a href=""> <img src="images/ks-4.gif" border="2"  class="ks"  id="ks4"/></a>
                 <a href=""> <img src="images/ks-5.gif" border="2"  class="ks"  id="ks5"/></a>
                 <a href=""> <img src="images/ks-6.gif" border="2"  class="ks"  id="ks6"/></a>
                <a href=""><img src="images/ks-8.gif" border="2"  class="ks"  id="ks8"/></a> 
 		 </div>
		<div id="bottom">
		<iframe src="bottom.html" width="100%" height="240px" scrolling="no" MARGINHEIGHT="0" MARGINWIDTH="0" align="middle" frameborder="0"></iframe>
        </div>
		
	
</div>
</body>
</html>
